package com.newasia.shopping.dto;

import com.newasia.commons.result.AbstractRequest;
import com.newasia.commons.tool.exception.ValidateException;
import com.newasia.shopping.constants.ShoppingRetCode;
import lombok.Data;

import java.util.List;

@Data
public class ItemSpecRequest extends AbstractRequest {

    private Long spuId;

    private List<Long> valueIds;

    @Override
    public void requestCheck() {
        if ("".equals(spuId)||valueIds.size()<1){
            throw new ValidateException(
                    ShoppingRetCode.REQUISITE_PARAMETER_NOT_EXIST.getCode(),
                    ShoppingRetCode.REQUISITE_PARAMETER_NOT_EXIST.getMessage());
        }
    }
}
